﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserRole.ascx.cs" Inherits="Admin_Components_Member_UserRole" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:ScriptManager ID="ScriptManager2" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
       
        <div class="accordion" id="monogram-acc">
            <div class="accordion-group panel panel-primary">
                <!-- Default panel contents -->
                <div class="accordion-heading accordion-toggle panel-heading" data-toggle="collapse" data-parent="monogram-acc" href="#Function">
                    Phân quyền user
                </div>
                <div class="accordion-body in" id="Function" >
                    <div class="panel-body">  
                        <div class="form-horizontal col-md-10 wrapper-center">
                            <div class="form-group">                                   
                                <label class="col-md-6 control-label">Nhóm quyền</label>
                                <div class="col-md-6">
                                    <telerik:RadComboBox  runat="server" ID="cboRole" EmptyMessage="---Chọn---" HighlightTemplatedItems="true"
                                        EnableLoadOnDemand="true" Filter="StartsWith" >
                                    </telerik:RadComboBox>
                                </div>
                            </div>                      
           
                            <%---------------------------------------------New version-------------------------------------------%>
                            <div class="form-group">  
                                <label class="col-md-6 control-label">User</label>
                                <div class="col-md-6">
                                     <telerik:RadComboBox ID="cboUser" runat="server"  EmptyMessage="---Chọn---" HighlightTemplatedItems="true"
                                        EnableLoadOnDemand="true"    Filter="StartsWith">
                                    </telerik:RadComboBox>
                                </div>        
                            </div>

                             <div class="form-group">  
                                <label class="col-md-6 control-label"></label>
                                <div class="col-md-6">
                                     <asp:Button ID="btnSave" runat="server" Text="Lưu" 
                                         CssClass="btn btn-sm btn-primary submit" TabIndex="10" 
                                         onclick="btnSave_Click" />

                                         <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" 
                                         CssClass="btn btn-sm btn-primary submit" TabIndex="10" 
                                         onclick="btnSearch_Click" />
                                </div>        
                            </div>

                        </div>
                    </div>
                </div>


                <div class="grid wapperMin">
                    <telerik:RadGrid ID="grvData" runat="server" CellSpacing="0" GridLines="None" AutoGenerateColumns="False"
                        HeaderStyle-HorizontalAlign="Center" AllowMultiRowSelection="True" OnItemCommand="grvData_ItemCommand"
                         HeaderStyle-BorderStyle="None">
                        <MasterTableView ShowHeader="true" AllowPaging="False" PageSize="20" NoMasterRecordsText="Không có dữ liệu."
                            ShowGroupFooter="true">
                            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="STT" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%# Container.ItemIndex + 1 %></ItemTemplate>
                                    <HeaderStyle Width="50px"/>
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                                
                                <telerik:GridBoundColumn SortExpression="FunctionName" HeaderText="Tên nhóm quyền"
                                    HeaderButtonType="TextButton" DataField="RoleName" UniqueName="RoleName">
                                    <HeaderStyle HorizontalAlign="Left"/>
                                    <ItemStyle />
                                </telerik:GridBoundColumn>
                               
                                
                                <telerik:GridBoundColumn SortExpression="UserName" HeaderText="User"
                                    HeaderButtonType="TextButton" DataField="UserName" UniqueName="UserName"
                                    ItemStyle-HorizontalAlign="Center" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                               
                                <telerik:GridTemplateColumn HeaderText="Sửa" Visible="true" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="lnkEditItem" CssClass="btnDelete" CommandArgument='<%# Eval("ID") %>'
                                            CommandName="EditItem" runat="server"></asp:Button>
                                    </ItemTemplate>
                                    <HeaderStyle Width="30px"/>
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                                  <telerik:GridTemplateColumn HeaderText="Xóa" Visible=true HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="lnkEditDel" CssClass="btnX" CommandArgument='<%# Eval("ID") %>'
                                            OnClientClick="return ConfirmOnDelete('Bạn chắc chắn muốn xóa?')" CommandName="EditDelItem"
                                            runat="server"></asp:Button>
                                    </ItemTemplate>
                                    <HeaderStyle Width="30px"/>
                                      <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings>
                            <Selecting AllowRowSelect="true" />
                        </ClientSettings>
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
                    </telerik:RadGrid>
                </div>
            </div>   
        </div>  
    </ContentTemplate>
</asp:UpdatePanel>
<div class="progressbar">
    <asp:UpdateProgress ID="up" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div class="bg">
                <div class="progress progress-striped active">
                    <div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0"
                        aria-valuemax="100" style="width: 100%">
                        <span class="sr-only">100% Complete</span>
                    </div>
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
</div>
